<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%-- 包含 --%>
<%@ include file="/common/include/page.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>管理员列表 - ssm</title>
	</head>
	<body>
		管理员列表
		<a href="${rootPath }/">管理员添加</a>
		<table width="80%" border="1">
			<tr>
				<td>序号</td>
				<td>id</td>
				<td>角色名称</td>
				<td>邮箱</td>
				<td>真实姓名</td>
				<td>qq</td>
				<td>phone</td>
				<td>状态</td>
				<td>创建时间</td>
				<td>更新时间</td>
			</tr>
			<c:forEach items="${requestScope.adminsList }" var="admins" varStatus="stat">
				<tr>
					<td>${stat.count}</td>
					<td>${admins.id }</td>
					<td>${admins.role.name }</td>
					<td>
						${admins.email }
						<!-- 实现email@左边的三位隐藏
							str = 12322bcd@22.com
							12322 *** @22.com
							java代码:
							
							12322:str.substring(0,str.indexOf('@') - 3)
							***:***
							@22.com:str.substring(str.indexOf('@'),str.length)
							
							存储值
							int aindex = str.indexOf('@') ; 
							JSTL+$也是这个思路
							function:
							${不能嵌套},
							fn嵌套读起来费劲
						 -->
						 ---${fn:indexOf(admins.email, "@")}--
						 <!-- 
						 	jstl也可以抽取变量
							@的位置
						 	int aIndex = str.indexOf('@') ; 
						  -->
						 <c:set value="${fn:indexOf(admins.email, '@')}" var="aIndex"/>
						 <c:set value="${fn:length(admins.email)}" var="alength"/>
						 
						 ${fn:substring(admins.email, 0, aIndex - 3)}
						 ***
						 ${fn:substring(admins.email, aIndex, alength ) }
					</td>
					<td>${admins.name }</td>
					<td>${admins.qq}</td>
					<td>${admins.phone }</td>
					<td>
						${admins.statusStr }
						<%-- <c:choose>
							<c:when test="${admins.status == 0}">
								禁用
							</c:when>
							<c:when test="${admins.status == 1}">
								启用
							</c:when>
						</c:choose> --%>
					</td>
					<td><fmt:formatDate value="${admins.createTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
					<td><fmt:formatDate value="${admins.updateTime }" pattern="yyyy-MM-dd HH:mm:ss"/></td>
				</tr>
			</c:forEach>
		</table>
	</body>
</html>